import {
    AutoLink,
    Autosave,
    Bold,
    Essentials,
    Italic,
    Link,
    Paragraph,
    Table,
    TableCaption,
    TableCellProperties,
    TableColumnResize,
    TableLayout,
    TableProperties,
    TableToolbar,
    Alignment,
    Autoformat,
    BlockQuote,
    CloudServices,
    Code,
    CodeBlock,
    FindAndReplace,
    Font,
    GeneralHtmlSupport,
    Heading,
    HorizontalLine,
    HtmlEmbed,
    Image,
    ImageCaption,
    ImageInsert,
    ImageResize,
    ImageStyle,
    ImageToolbar,
    ImageUpload,
    Base64UploadAdapter,
    Indent,
    IndentBlock,
    LinkImage,
    List,
    ListProperties,
    MediaEmbed,
    Mention,
    PageBreak,
    PasteFromOffice,
    PictureEditing,
    RemoveFormat,
    ShowBlocks,
    Strikethrough,
    Style,
    Subscript,
    Superscript, TextPartLanguage, TextTransformation, TodoList, Underline
} from 'ckeditor5';

import translations from 'ckeditor5/translations/zh-cn.js';
export default {
    fontFamily:{
        options: [
            '宋体',
            '黑体',
            '楷体',
            '仿宋',
            '微软雅黑',
            'Arial, Helvetica, sans-serif',
            'Arial Black, Gadget, sans-serif',
            'Comic Sans MS, cursive, sans-serif',
            'Courier New, Courier, monospace',
            'Georgia, serif',
        ]
    },
    fontSize: {
        options: [
            9,
            10,
            12,
            'default',
            14,
            16,
            18,
            20,
            24,
            28,
            32,
            36,
            40,
            44,
            48,
        ]
    },
    toolbar: {
        shouldNotGroupWhenFull: true,
        items: [
            // --- Document-wide tools ----------------------------------------------------------------------
            'undo',
            'redo',
            '|',

            // --- "Insertables" ----------------------------------------------------------------------------

            'link',
            'insertTable',
            'blockQuote',
            'pageBreak',
            'horizontalLine',
            '-',

            // --- Block-level formatting -------------------------------------------------------------------
            'heading',
            '|',

            // --- Basic styles, font and inline formatting -------------------------------------------------------

            'fontSize',
            'fontFamily',
            'fontColor',
            'fontBackgroundColor',
            'superscript',
            'subscript',
            'bold',
            'italic',
            'underline',
            'strikethrough',
            'removeFormat',
            '|',

            // --- Text alignment ---------------------------------------------------------------------------
            'alignment',
            '|',

            // --- Lists and indentation --------------------------------------------------------------------
            'bulletedList',
            'numberedList',
            'todoList',
            '|',
            'outdent',
            'indent',
            '|',
        ]
    },
    plugins: [
        Autosave,
        Alignment,
        Autoformat,
        AutoLink,
        BlockQuote,
        Bold,
        CloudServices,
        Code,
        CodeBlock,
        Essentials,
        FindAndReplace,
        Font,
        GeneralHtmlSupport,
        Heading,
        HorizontalLine,
        HtmlEmbed,
        Image,
        ImageCaption,
        ImageInsert,
        ImageResize,
        ImageStyle,
        ImageToolbar,
        ImageUpload,
        Base64UploadAdapter,
        Indent,
        IndentBlock,
        Italic,
        Link,
        LinkImage,
        List,
        ListProperties,
        MediaEmbed,
        Mention,
        PageBreak,
        Paragraph,
        PasteFromOffice,
        PictureEditing,
        RemoveFormat,
        ShowBlocks,
        Strikethrough,
        Style,
        Subscript,
        Superscript,
        Table,
        TableCaption,
        TableCellProperties,
        TableColumnResize,
        TableLayout,
        TableProperties,
        TableToolbar,
        TextPartLanguage,
        TextTransformation,
        TodoList,
        Underline,
    ],
    initialData: '',
    language: 'zh-cn',
    licenseKey: 'GPL',
    link: {
        addTargetToExternalLinks: true,
        defaultProtocol: 'https://',
        decorators: {
            toggleDownloadable: {
                mode: 'manual',
                label: 'Downloadable',
                attributes: {
                    download: 'file'
                }
            }
        }
    },
    placeholder: 'Type or paste your content here!',
    table: {
        contentToolbar: ['tableColumn', 'tableRow', 'mergeTableCells', 'tableProperties', 'tableCellProperties']
    },
    translations: [translations]
};